package com.zd.springcloud.provider.tccaction;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

@LocalTCC
public interface GoodAction {

    @TwoPhaseBusinessAction(useTCCFence = true, name = "reduceStock",commitMethod = "commit",rollbackMethod = "rollback")
    public void reduceStock(BusinessActionContext businessActionContext,
                            @BusinessActionContextParameter("num") int num,
                            @BusinessActionContextParameter("goodId")long goodId);


    void commit(BusinessActionContext businessActionContext);

    void rollback(BusinessActionContext businessActionContext);
}
